-
-
Notifications
You must be signed in to change notification settings - Fork 18k
stdenv: fix succeedOnFailure #200917
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stdenv: fix succeedOnFailure #200917
Conversation
|
I believe this effect is better achieved via #196251 |
knedlsepp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used the following to confirm that it works as intended:
let
pkgs = import ./. { };
in pkgs.runCommand "foo" {
succeedOnFailure = true;
} ''
mkdir $out
echo foo > $out/foo
exit 1
''
Thank you! :-)
|
Apparently ofborg is quick enough to test a stdenv rebuild, so I've added @knedlsepp's test to the |
|
@roberth thanks for adding a test. One note: Due to the nature of |
|
@knedlsepp as far as I know, It does not invert the exit status either, like #196251 would. |
It's true that nix itself does not have any special interpretation, but hydra does. It renders these outputs with a red cross as I'd they failed, but offers downloads in Anyway, I couldn't find the test that you added in the most recent hydra evaluation, so it doesn't really matter. 😄 Edit: Just noticed that I didn't look at the staging evaluation, but trunk. 🤔 |
|
That's a bad hack for something that should be solved by Nix itself, but alright then. By default the package |
| tests = { | ||
| succeedOnFailure = import ../tests/succeedOnFailure.nix { inherit stdenv; }; | ||
| }; | ||
| passthru.tests = lib.warn "Use `stdenv.tests` instead. `passthru` is a `mkDerivation` detail." stdenv.tests; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be triggered by nix eval? I have encountered this on my system and other peoples and I am unsure if the issue is here or in nix eval.
Description of changes
Closes #200663
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes